package com.hg.library.utils;

import android.database.Observable;
import android.util.*;

import com.hg.library.http.HttpAgent;

import java.io.IOException;

import okhttp3.Request;
import okhttp3.Response;

/**
 * Created by admin on 2016/11/15.
 */
public class CensusUtils {
    private static final String TAG = "CensusUtils";
    public static void upLoadInstallData(final String packageName, final int status, final int from){
        new Thread(new Runnable() {
            @Override
            public void run() {

                Request request = new Request.Builder().url("https://api.hispot.cn/dataStatistics/saveAppDuration/"+packageName+"/"+status+"/"+from).build();

                try {
                    Response execute = HttpAgent.getOkHttpClient().newCall(request).execute();
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (NullPointerException e){
                    e.printStackTrace();
                }

            }
        }).start();
    }
}
